import { Vue } from 'vue-property-decorator'
import { ComponentModel } from '@TG/interface'
import { buildDOMKey } from '@TG/kit/element'

export default abstract class extends Vue {
  public buildDOMKey(cm: ComponentModel, index: number = 0) {
    return buildDOMKey(cm, index)
  }

  public abstract defaultRef(): string

  public ref(key: string = this.defaultRef()) {
    return this.$refs[`ref-${key}`]
  }

  public refs() {
    return this.$refs
  }
}
